package com.allqj.sfx.ddd.member.infrastructure.converter;

import com.allqj.sfx.ddd.member.domain.entity.admin.Tenant;
import com.allqj.sfx.ddd.member.infrastructure.dao.TenantDAO;
import com.allqj.sfx.ddd.member.infrastructure.po.TenantDO;
import com.allqj.sfx.infrastructure.converter.DataConverter;
import org.springframework.beans.BeanUtils;

/**
 * @author sjw
 * @className TenantConverter
 * @date 2022/7/28 17:11
 * @description: 转换器
 */
public class TenantConverter implements DataConverter<Tenant, TenantDO, TenantDAO> {

    public static TenantConverter INSTANCE = new TenantConverter();

    @Override
    public Tenant do2Entity(TenantDO tenantDO) {
        if (tenantDO == null) return null;
        Tenant tenant = new Tenant();
        BeanUtils.copyProperties(tenantDO, tenant);
        return tenant;
    }

    @Override
    public TenantDO entity2Do(Tenant tenant) {
        return null;
    }

    @Override
    public TenantDO entity2Do(Tenant tenant, TenantDAO tenantDAO) {
        return null;
    }
}
